﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace jQueryDotNetLib.Controls
{
    [ToolboxData("<{0}:TabPage TabName=\"\" runat=\"server\"></{0}:TabPage>")]
    [Serializable()]
    public class TabPage : System.Web.UI.WebControls.Panel
    {
        public string TabName
        {
            get;
            set;
        }
        protected override void Render(HtmlTextWriter writer)
        {
            if (TabName != null)
            {
                writer.Write("<div id=" + TabName + ">");
                foreach (Control c in this.Controls)
                {
                    if (c.Page == null) c.Page = this.Page;
                    c.RenderControl(writer);
                }
                writer.Write("</div>");
            }
        }
    }
}
